package com.ramms.eater.view;

import com.ramms.eater.R;
import com.ramms.eater.parser.entity.Section;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class ItemSection {
	
	private Section section;
	private OnClickListener listener;
	private View view = null;

	public ItemSection(Section section, OnClickListener listener) {
		this.section = section;
		this.listener = listener;
	}

	public void generateView(ViewGroup parent) {
		View rview = LayoutInflater.from(parent.getContext()).inflate(R.layout.itemsection, null);
        TextView title = (TextView) rview.findViewById(R.id.titulo);  
        title.setText(section.getName());
        title.setOnClickListener(listener);
        view = rview;
	}

	public Section getSection() {
		return section;
	}

	public void setSection(Section section) {
		this.section = section;
	}

	public OnClickListener getListener() {
		return listener;
	}

	public void setListener(OnClickListener listener) {
		this.listener = listener;
	}

	public View getView() {
		return view;
	}

	public void setView(View view) {
		this.view = view;
	}
	
}
